/*
 * @Author: lsjweiyi 759209794@qq.com
 * @Date: 2024-04-10 21:32:29
 * @LastEditors: lsjweiyi 759209794@qq.com
 * @LastEditTime: 2024-05-12 18:59:04
 * @FilePath: \web-ssg\composables\moduleDefinition.ts
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
// 首页的导航栏
export const topMenuList: MenuItem[] = [
    { key: "", name: "首页", routerName: "home" },
    { key: "", name: "图像技术", routerName: "image" },
];
// 小站介绍的导航栏
export const homeMenuList: MenuItem[] = [
    { key: "home", name: "小站总览", routerName: "" },
    { key: "home", name: "小站理念", routerName: "idea" },
    { key: "home", name: "反馈建议", routerName: "suggest" },
];

// 图片的导航栏
export const imageMenuList: MenuItem[] = [
    {
        key: "index",
        name: "图片转Word/Excel",
        routerName: "",
        toolId: 27,
        description:
            "可识别图片内容，并转换为保留原文档版式的Word、Excel文档，方便二次编辑和复制，可支持含表格、试卷、公式、印章、水印、手写等内容的文档图片。为您节省大量的时间，包您满意！",
    },
    {
        key: "image",
        name: "人像分割 | 证件照换底色",
        routerName: "idcardChangeColor",
        toolId: 1,
        description: "将人像和背景进行分割，背景完全透明化，也就可以实现给照片换底色，图片中如果没有人像，就会分割失败哦！",
    },
    {
        key: "image",
        name: "文档图片去底纹/水印",
        routerName: "docRepair",
        toolId: 24,
        description: "翻拍的图片，底色是暗暗的，打印出来甚是明显，通过AI处理过后，就像扫描的一样干净，阅读效果好很多，还可以去除文档的水印哦",
    },
    {
        key: "image",
        name: "去除文档手写字",
        routerName: "removeHandWrite",
        toolId: 26,
        description: "去除图片中的手写内容，保留印刷体内容，可用于试卷去手写还原等场景，除非你写得很像印刷体！",
    },
    {
        key: "image",
        name: "图像无损放大两倍",
        routerName: "imgQualityEnhance",
        toolId: 23,
        description: "普通的图片放大就会有明显像素点，AI技术能补全图片像素点，当然，最多也只能支持放大两倍",
    },
    {
        key: "image",
        name: "图片清晰度增强",
        routerName: "imgDefinitionEnhance",
        toolId: 21,
        description: "利用AI技术修补图像细节，使图像清晰度明显提高。会在一定程度上使图片变大",
    },
    {
        key: "image",
        name: "黑白图片上色",
        routerName: "gray2colourize",
        toolId: 22,
        description: "给黑白图像图上合理的彩色，下面实例展示了和原图的对比效果，虽然没法恢复到原图的效果，但是看上去也很合理嘛！",
    },
    {
        key: "image",
        name: "去除摩尔纹",
        routerName: "removeMoire",
        toolId: 25,
        description: "以前旧相机对着电子屏幕翻拍时，会有明显的摩尔纹，利用AI在一定程度上去去除摩尔纹，但效果有限，只能去除部分摩尔纹。",
    },
    { key: "image", name: "图片格式转换", routerName: "imgConvers", toolId: 4, description: "有些简单的格式转换画图工具就可以做到，但是有些不常见的格式，您还得找我" },
    { key: "image", name: "图片有损压缩", routerName: "imgCompress", toolId: 2, description: "压缩图像到您想要的大小，压缩后图像质量会降低。当然，压缩也是会有极限的哦" },
    {
        key: "image",
        name: "png无损压缩",
        routerName: "pngCompress",
        toolId: 3,
        description: "png支持无损压缩，压缩后图片质量不会降低。但是压缩的范围是有限的，如果不满足，请移步有损压缩",
    },
];

// 左侧工具栏有新增类别的话，需要到此新增
export const leftMenuList: Map<string, MenuItem[]> = new Map();
leftMenuList.set("home", homeMenuList);
leftMenuList.set("image", imageMenuList);

export type MenuItem = {
    key: string;
    name: string;
    routerName: string;
    description?: string;
    toolId?: number;
};

export function getImageMenuItem(toolName: string) {
    return imageMenuList.find((item) => item.routerName === toolName) as MenuItem;
}
export function getHomeMenuItem(toolName: string) {
    return homeMenuList.find((item) => item.routerName === toolName) as MenuItem;
}
